package com.zbkj.front.controller;

import com.zbkj.common.page.CommonPage;
import com.zbkj.common.request.project.*;
import com.zbkj.common.response.CommonResult;
import com.zbkj.common.response.UploadResponse;
import com.zbkj.common.response.project.ClientProjectInfoResponse;
import com.zbkj.common.response.project.InformationResponse;
import com.zbkj.common.response.project.ProjectStatusCountResponse;
import com.zbkj.common.response.project.ReportInfoResponse;
import com.zbkj.front.service.ProjectHandleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Auther:
 * @Date: 2024/7/6 14:04
 * @Description:
 */
/*@RestController
@RequestMapping("api/front/project")
@Api(tags = "项目服务")*/
public class ProjectController {
    /*
    @Autowired
    private ProjectHandleService projectHandleService;

    @ApiOperation(value="获取项目各状态数量")
    @GetMapping("/getProjectStatusCount")
    public CommonResult<ProjectStatusCountResponse> getProjectStatusCount() {
        return CommonResult.success(projectHandleService.getProjectStatusCount());
    }

    @ApiOperation(value="项目资料上传")
    @PostMapping("/informationUpload/{type}")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "type",value = "材料类型：1 实施方案，2预采购硬件设备"),
    })
    public CommonResult<UploadResponse> informationUpload(@PathVariable("type") Integer type, MultipartFile file) {
        return CommonResult.success(projectHandleService.informationUpload(type,file));
    }

    @ApiOperation(value="新建项目")
    @PostMapping("/createProject")
    public CommonResult createProject(@RequestBody @Validated({ClientProjectRequest.CreateProjectGroup.class})
                                    ClientProjectRequest projectRequest) {
        projectHandleService.createProject(projectRequest);
        return CommonResult.success();
    }

    @ApiOperation(value="项目列表查询")
    @PostMapping("/projectList")
    public CommonResult<CommonPage<ClientProjectInfoResponse>> projectList(@RequestBody ClientProjectQueryRequest queryRequest) {
        return CommonResult.success(CommonPage.restPage(projectHandleService.projectList(queryRequest)));
    }

    @ApiOperation(value="项目催单")
    @GetMapping("/remindProject/{projectId}")
    public CommonResult remindProject(@PathVariable("projectId") Long projectId) {
        projectHandleService.remindProject(projectId);
        return CommonResult.success();
    }

    @ApiOperation(value="撤销项目")
    @GetMapping("/withdrawProject/{projectId}")
    public CommonResult withdrawProject(@PathVariable("projectId") Long projectId) {
        projectHandleService.withdrawProject(projectId);
        return CommonResult.success();
    }

    @ApiOperation(value="获取项目信息")
    @GetMapping("/getProjectInfo/{projectId}")
    public CommonResult<ClientProjectInfoResponse> getProjectInfo(@PathVariable("projectId") Long projectId) {
        return CommonResult.success(projectHandleService.getProjectInfo(projectId));
    }

    @ApiOperation(value="项目重新提交")
    @PostMapping("/resubmitProject")
    public CommonResult resubmitProject(@RequestBody @Validated({ClientProjectRequest.ResubmitProjectGroup.class})
                                      ClientProjectRequest projectRequest) {
        projectHandleService.resubmitProject(projectRequest);
        return CommonResult.success();
    }

    @ApiOperation(value="删除项目")
    @GetMapping("/delProject/{projectId}")
    public CommonResult delProject(@PathVariable("projectId") Long projectId) {
        projectHandleService.delProject(projectId);
        return CommonResult.success();
    }

    @ApiOperation(value="项目源文件下载列表")
    @GetMapping("/getValidProjectFileList/{projectId}")
    public CommonResult<List<InformationResponse>> getValidProjectFileList(@PathVariable("projectId") Long projectId) {
        return CommonResult.success(projectHandleService.getValidProjectFileList(projectId));
    }

    @ApiOperation(value="项目确认操作")
    @GetMapping("/projectConfirm/{projectId}/{status}")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "status",value = "处理类型：30估算完成确认,40 申请报告，50 确认完成")
    })
    public CommonResult projectConfirm(@PathVariable("projectId") Long projectId, @PathVariable("status") Integer status) {
        projectHandleService.projectConfirm(projectId, status);
        return CommonResult.success();
    }

    @ApiOperation(value="估算资料下载")
    @PostMapping("/informationDownload")
    public void informationDownload(@RequestBody @Validated ClientProjectDownloadRequest downloadRequest, HttpServletResponse response) {
        projectHandleService.informationDownload(downloadRequest, response);
    }

    @ApiOperation(value="项目估算资料列表查询")
    @PostMapping("/getInformationList")
    public CommonResult<CommonPage<InformationResponse>> getInformationList(@RequestBody @Validated InformationQueryRequest queryRequest) {
        return CommonResult.success(CommonPage.restPage(projectHandleService.getInformationList(queryRequest)));
    }

    @ApiOperation(value="获取估算结果内容")
    @PostMapping("/getReportInfo")
    public CommonResult<ReportInfoResponse> getReportInfo(@RequestBody @Validated ClientResportInfoRequest queryRequest) {
        return CommonResult.success(projectHandleService.getReportInfo(queryRequest));
    }
*/
}

